<template>
    <div class="newDetail">
        <Header></Header>

        <div class="detailBox">
            <div class="about-box" v-html="content"></div>

        </div>
    </div>
</template>

<script>
import Header from '@/components/header/index.vue'
import { messageDetail, remindDetail } from "@/utils/api"
export default {
    components: {
        Header,
    },
    data() {
        return {
            messageId: "",
            content: '',
        }
    },
    created() {
        console.log(this.$route.query)
        if (this.$route.query.type == 'message') {
            this.getmessageDetail(this.$route.query.id)
            this.messageId = this.$route.query.id
        } else {
             this.getremindDetail(this.$route.query.id)
        }

    },
    methods: {

        async getmessageDetail(id) {
            let res = await messageDetail({
                token: localStorage.getItem('token'),
                id: id
            })
            console.log("消息详情", res)
            this.content = res.data.content
        },
        async getremindDetail(id) {
            let res = await remindDetail({
                token: localStorage.getItem('token'),
                id: id
            })
            this.content = res.data.content
        }

    },

}
</script>

<style scoped lang="scss">
.detailBox {
    width: 1920px;
    margin: 0 auto;
}
</style>